package gao.xaiolei.enity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Embeddable;

@Embeddable
public class TaskGroupId implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -3917743935451646924L;

	// 任务接受组Id
	@Column(name = "GROUP_ID", nullable = false, columnDefinition = "char(32)")
	private String GROUP_ID;

	// 任务Id
	@Column(name = "TASK_ID", nullable = false, columnDefinition = "char(32)")
	private String TASK_ID;

	public TaskGroupId() {
		super();
	}

	public TaskGroupId(String tASK_ID,String gROUP_ID) {
		super();
		GROUP_ID = gROUP_ID;
		TASK_ID = tASK_ID;
	}

	public String getGROUP_ID() {
		return GROUP_ID;
	}

	public void setGROUP_ID(String gROUP_ID) {
		GROUP_ID = gROUP_ID;
	}

	public String getTASK_ID() {
		return TASK_ID;
	}

	public void setTASK_ID(String tASK_ID) {
		TASK_ID = tASK_ID;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((GROUP_ID == null) ? 0 : GROUP_ID.hashCode());
		result = prime * result + ((TASK_ID == null) ? 0 : TASK_ID.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		TaskGroupId other = (TaskGroupId) obj;
		if (GROUP_ID == null) {
			if (other.GROUP_ID != null)
				return false;
		} else if (!GROUP_ID.equals(other.GROUP_ID))
			return false;
		if (TASK_ID == null) {
			if (other.TASK_ID != null)
				return false;
		} else if (!TASK_ID.equals(other.TASK_ID))
			return false;
		return true;
	}

}
